package com.indusfo.spc.mapper;

import com.indusfo.spc.common.pojo.Temporary;
import com.indusfo.spc.pojo.MatRepair;
import com.indusfo.spc.pojo.RepairDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RepairDetailMapper {

    //新增
    int insertRepairDetail(RepairDetail repairDetail);

    //查询单个
    List<RepairDetail> selectByPrimaryKey(RepairDetail repairDetail);

    //修改
    int updateByPrimaryKeySelective(RepairDetail repairDetail);

    //查询是否存在
    Integer selectRepairDetail(RepairDetail repairDetail);

    //分页所有
    List<RepairDetail> selectAll(RepairDetail repairDetail);

    //计数
    int countRepairDetail(RepairDetail repairDetail);

    //删除 自身ID
    int delteRepairDetail(@Param("RepairDetailIds") Long[] RepairDetailIds, @Param("dataState") Integer dataState);

    //批量新增
    int insertRepairDetailAll(@Param("proIds") Long[] proIds, @Param("repairId") Integer repairId);

    // 查询指定offlineId
    List<Temporary> selectByRepairId(@Param("repairId") Integer repairIds);

    // 删除   父类ID
    int delteRepairDetailByRepairId(@Param("repairIds") Long[] repairIds, @Param("dataState") Integer dataState);

    List<RepairDetail> queryRepairDetailToInsert(RepairDetail repairDetail);

    Integer countRepairDetailToInsert(RepairDetail repairDetail);
    List<RepairDetail> queryRepairDetailByMatRepairList(@Param("matRepairList") List<MatRepair> matRepairList);

    /**
     * 查询维修工序段子工序使用过的工序
     * @param proIds
     * @return
     */
    int queryUserPro(@Param("proIds") Long[] proIds);
}